import os
import django

DJANGO_ROOT=os.path.dirname(os.path.realpath(django.__file__))
SITE_ROOT=os.path.dirname(os.path.realpath(__file__))
DATE_FORMAT='Y-m-d'

# Django settings for mysite project.

DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEBUG_PROPOGATE_EXCEPTIONS=DEBUG

ADMINS = (
	('Feng Xia', 'feng_xia41103@hotmail.com'),
)

MANAGERS = ADMINS


DATABASE_ENGINE='mysql'
DATABASE_NAME='webtj3'
DATABASE_USER='root'
DATABASE_PASSWORD='natalie'
DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

# emails
EMAIL_HOST = 'mail.crunchtime.local'
EMAIL_HOST_USER = 'fxia'
EMAIL_HOST_PASSWORD = 'XFxf123456'
DEFAULT_FROM_EMAIL = 'fxia@crunchtime.com'
SERVER_EMAIL = 'fxia@crunchtime.com'


TIME_ZONE = 'America/New_York'

LANGUAGE_CODE = 'en-us'

SITE_ID = 1

USE_I18N = True

MEDIA_ROOT = os.path.join(os.path.dirname(SITE_ROOT), 'mysite', 'media')

# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com"
MEDIA_URL = 'http://localhost/media/'

# Absolute path to directory serving static files such as CSS, Javascripts
STATIC_DOC_ROOT = MEDIA_ROOT

ADMIN_MEDIA_PREFIX = '/media/admin/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'vmrj&a6l6d3pt+a@0v!e_v&=93p03anu-xp#1ozrqban6wb_s%'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.load_template_source',
    'django.template.loaders.app_directories.load_template_source',
#     'django.template.loaders.eggs.load_template_source',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.middleware.csrf.CsrfResponseMiddleware',    
    #'django.middleware.transaction.TransactionMiddleware',
    #'reversion.middleware.RevisionMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

TEMPLATE_DIRS = (
    os.path.join(SITE_ROOT,'templates'),                                                                                                                                                                                                                                 
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    'django_extensions',
    'taggit', #tagging
    'taggit_templatetags',
    'mptt',
    'south',
    #'reversion',
    'mysite.tj3',
    'mysite.ct',
)

# Allow the following .ext to be uploaded
ALLOWED_IMAGE_EXT = ['.jpg', '.jpeg', '.png', '.gif', '.bmp',]

#LOGIN_REDIRECT_URL='/mysite/'
